<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="${path}/css/xiangxixinxi.css">
    <link rel="stylesheet" href="${path}/plugins/bootstrap-3.3.7-dist/css/bootstrap.css">
    <link rel="stylesheet" href="${path}/css/TenantCentre.css">
    <script src="${path}/plugins/jquery-3.4.1.js"></script>
    <script src="${path}/plugins/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=fpU60fguMvVvAbgqFUNueAjKSBFuQN7R"></script>
    <script type="text/javascript" src="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
    <link rel="stylesheet" href="//api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css" />

    <link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
          rel="stylesheet">
    <script src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="${path}/plugins/echarts.min.js"></script>
<%--     <script src="//libs.baidu.com/jquery/1.9.0/jquery.js"></script>--%>
   </head>
<style>
    .gray-bg{
        margin: 0;
        padding: 0;
        font-family: sans-serif;
        background: url(http://${path2}/img/loginimg.jpg)  no-repeat center 0px;
        background-size: cover;

        background-position: center 0;
        background-repeat: no-repeat;
        background-attachment: fixed;
        -webkit-background-size: cover;
        -o-background-size: cover;
        -moz-background-size: cover;
        -ms-background-size: cover;

    }
     #container {
         overflow: hidden;
         width: 100%;
         height: 100%;
         margin: 0;
         font-family: "微软雅黑";
     }

    .outer{
        width: 200px;
        height: 200px;
        background-color: #000;
        /*opacity: 0.8;*/
        position:absolute;
    }
</style>

</head>

<body class="gray-bg">

<%@ include file="../nav/headnav.jsp" %>

<div class="a" >


    <div class="container"style="background-color: #eaedef;">

        <div class="row second-row">
            <div class="col-md-6" style="padding: 0px">
                <div id="demo" class="carousel slide">
                    <input class="hidden" id="size" value="${size}">
                    <!-- 轮播begin -->
                    <div id="myCarousel" class="carousel slide col-sm-12 col-md-9"
                         style="float: right;width:100%;height: 450px;">
                        <!-- 轮播（Carousel）指标 -->
                        <ol id="tr_id1" class="carousel-indicators">
                        </ol>
                        <!-- 轮播（Carousel）项目 -->
                        <div id="lun" class="carousel-inner">
                        </div>
                        <!-- 轮播（Carousel）导航 -->
                        <a class="carousel-control left" href="#myCarousel"
                           data-slide="prev"><span _ngcontent-c3="" aria-hidden="true"
                                                   class="glyphicon glyphicon-chevron-left"></span></a>
                        <a class="carousel-control right" href="#myCarousel"
                           data-slide="next"><span _ngcontent-c3="" aria-hidden="true"
                                                   class="glyphicon glyphicon-chevron-right"></span></a>
                    </div>
                    <!-- 轮播end -->
                </div>
            </div>

            <!--        轮播图右侧信息-->
            <div class="col-md-6" style="border: 1px #9fdcd6 solid;">
                <div class="row" style="border-bottom: 1px gainsboro solid">
                    <div class="col-md-12">
                        <div class="row" style="padding-top: 20px;padding-left: 10px;">
                            <div class="col-md-12" style="padding: 0px;padding-left: 5px;">
                                <h3><b>${house.region}&middot;${house.residentialQuarters}&middot;${house.rentType}&middot;${house.houseType}</b></h3>
                            </div>
                        </div>
                        <div style="padding: 0px;padding-top: 20px;">
                            <h3><b>房源编号:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b><b>${house.id}</b></h3>
                        </div>
                        <div class="col-md-8">
                            <p></p>
                        </div>
                    </div>
                    <div class="col-md-12" style="margin-bottom: 5%;margin-top: 5%">
                        <div class="row">
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-6" style="padding:0px;">
                                <h3><b><a style="color: red;">${cost.rentMoney} 元/月</a></b></h3>
                            </div>
                            <div class="col-md-2">
                            </div>
                            <div class="col-md-3">
                                <input id="ifconcern" type="button" value="关注" onclick="change(this)"/>
                                <!--                            <button>关注</button>-->
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12" style="padding:3%;">
                        <div class="row" id="big">
                            <div class="col-md-4 " id="pet" name="pet">
                                <img src="http://${path2}/img/agents.jpg" style="height:80px;width:60%">
                                <div class="yuyue" style="padding-top: 15px;">
                                    <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal2"
                                            style="background-color:#67b3e5;border: 0px;" onclick="iflogin()">
                                        联系电话
                                    </button>
                                </div>
                            </div>
                            <div class="col-md-4" style="padding-top: 20px;">
                                <div class="jjr1">
                                    <a>${agent.name}</a>
                                </div>
                                <div class="row">
                                    <div class="col-md-6" style="margin-top: 3%">
                                        <a>评分</a>
                                    </div>


                                    <div id="evaluate" class="col-md-6" style="margin-top: 3%">
                                        <a>${evaluate}</a>
                                    </div>


                                </div>
                            </div>
                            <div class="col-md-4" >
                                <div class="row rowst">
                                    <img src="http://${path2}/img/zhizhao.jpg" style="height:120px;width:80%;">
                                </div>
                            </div>

                            <div class="col-md-12">
                                <div class="row">
                                    <div class="col-md-7">
                                        <b>请为该经纪人评分</b>
                                        <ul id="find" class="comment" style=" list-style: none;">
                                            <li>☆</li>
                                            <li>☆</li>
                                            <li>☆</li>
                                            <li>☆</li>
                                            <li>☆</li>
                                        </ul>
                                    </div>
                                    <div class="col-md-5">
                                        <div class="yuyue" style="padding-top: 15px;text-align:center;">
                                            <!--                              <a href="#" style="border: 2px black solid; ">预约经纪人 </a>-->

                                            <button class="btn btn-primary btn-lg" data-toggle="modal"
                                                    data-target="#myModal"
                                                    style="background-color:#67b3e5;border: 0px;" onclick="iflogin()">
                                                预约经纪人
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>


                    </div>

                </div>
            </div>
            <!--    预约模态框-->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                 aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content" style="width: 600px;height:600px;">
                        <div class="modal-header">
                            <h4 class="modal-title" id="myModalLabel" style="margin-top: 10px">预约经纪人</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>

                        </div>
                        <div class="modal-body">
                            <div class="container-fluid">
                                <div class="col-md-12" style="padding:3%;">
                                    <div class="row">
                                        <div class="col-md-4">
                                            <img src="http://${path2}/img/${picture_one}" style="width: 100%; height: 120px;">
                                        </div>
                                        <div class="col-md-8">
                                            <div class="row">
                                                <div class="col-md-4" style="padding: 0px;padding-left: 5px;">
                                                    <h3>${house.region}</h3>
                                                </div>
                                                <div class="col-md-4" style="padding: 0px;">
                                                    <h3>${house.rentType}</h3>
                                                </div>
                                                <div class="col-md-4" style="padding: 0px;">
                                                    <h3> ${house.houseType}
                                                    </h3>
                                                </div>
                                            </div>
                                            <div class="col-md-12" style="padding:0px;margin-top:50px;">
                                                <h3><a style="color: red">${cost.rentMoney}元/月</a></h3>
                                            </div>
                                        </div>
                                        <form role="form">
                                            <div class="col-md-12">

                                                <div class="col-md-6" style="padding:0px;margin-top:50px;">
                                                    <div class="control-group">
                                                        <label class="control-label">看房日期</label>
                                                        <div class="controls input-append date form_date" data-date=""
                                                             data-date-format="dd MM yyyy"
                                                             data-link-field="appointment_date"
                                                             data-link-format="yyyy-mm-dd">
                                                            <input class="form-control" size="24" type="text" value=""
                                                                   readonly>
                                                            <span class="add-on"><i class="icon-remove"></i></span>
                                                            <span class="add-on"><i class="icon-th"></i></span>
                                                        </div>
                                                        <input type="hidden" id="appointment_date" value=""/><br/>
                                                        <input type="hidden" class="input-text" value="${house.id}"
                                                               name="houseId" id="houseId">
                                                        <input type="hidden" class="input-text" value="${agent.id}"
                                                               name="agentId" id="agentId">
                                                        <input type="hidden" class="input-text" value="${tenant.id}"
                                                               name="tenantId" id="tenantId">
                                                    </div>
                                                </div>
                                                <div class="col-md-6" style="padding:0px;margin-top:50px;">
                                                    <div class="form-group">
                                                        <label>看房时间</label>
                                                        <select id="time_quantum" class="form-control">
                                                            <option>上午</option>
                                                            <option>下午</option>
                                                            <option>晚上</option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="modal-footer">
                                                <%--                                            <button type="button" class="btn "  >关闭</button>--%>
                                                <button type="button" class="btn btn-primary btn-default"
                                                        onclick="iflogin(),checkname()" data-dismiss="modal">提交更改
                                                </button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal -->
            </div>


            <!--    联系电话模态框-->

            <div class=" modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2"
                 aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content" style="width: 600px;height:200px;">
                        <div class="modal-header">
                            <h4 class="modal-title" id="myModalLabel2">联系电话</h4>
                            <button type="button" class="close" data-dismiss="modal"
                                    aria-hidden="true">&times;
                            </button>

                        </div>
                        <div class="modal-body">
                            <phone>${agent.phone}</phone>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                            </button>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal -->
            </div>
            <!--锚点-->
            <div class="carousel-inner" style="text-align: center;">
                <div class="maodian" style="text-align: center;">
                    <div class="row rowm">
                        <div class="col-md-3">
                            <h5><a href="#miao1">基本信息</a></h5>
                        </div>
                        <div class="col-md-3">
                            <h5><a href="#miao7">房主要求</a></h5>
                        </div>
                        <div class="col-md-3">
                            <h5><a href="#miao8">详细要求</a></h5>
                        </div>
                        <div class="col-md-3">
                            <h5><a href="#miao2">周边环境</a></h5>
                        </div>
                        <div class="col-md-3">
                            <h5><a href="#miao3">配套设备</a></h5>
                        </div>
                        <div class="col-md-3">
                            <h5><a href="#miao4">费用详情</a></h5>
                        </div>
                        <div class="col-md-3">
                            <h5><a href="#miao5">房屋评价</a></h5>
                        </div>
                        <div class="col-md-3">
                            <h5><a href="#miao6">频率走势</a></h5>
                        </div>

                    </div>
                </div>
            </div>

            <!--房屋信息-->
            <div class="fangwuxinxi" style="margin: 20px;">
                <div class="row"style="padding: 0px;">
                    <div class="col-md-12" style="margin-bottom: 10px;">
                        <h1>房屋信息</h1>
                    </div>
                    <div class="col-md-12">
                        <div class="col-md-4" id="miao1">
                            <a>基本信息</a>
                        </div>
                        <div class="col-md-8">
                            <div class="row rowhouse">

                                <div class="col-md-6">
                                    <a>户型:&nbsp;&nbsp;${house.houseType}</a>
                                </div>

                                <div class="col-md-6">
                                    <a>面积:&nbsp;&nbsp;${house.area}</a>
                                </div>
                                <div class="col-md-6">
                                    <a>楼层:&nbsp;&nbsp;${house.floor}层</a>
                                </div>


                                <div class="col-md-6">
                                    <c:if test="${house.parkPlace}">
                                        <a>车位:&nbsp;&nbsp;有</a>
                                    </c:if>
                                    <c:if test="${!house.parkPlace}">
                                        <a>车位:&nbsp;&nbsp;无</a>
                                    </c:if>
                                </div>


                                <div class="col-md-6">
                                    <a>租期:&nbsp;&nbsp;${house.tenancy}</a>
                                </div>

                                <div class="col-md-6">
                                    <a>朝向:&nbsp;&nbsp;${house.orientate}</a>
                                </div>

                                <div class="col-md-6">
                                    <a>地区:&nbsp;&nbsp;${house.region}</a>
                                </div>

                                <div class="col-md-6">
                                    <a>类型:&nbsp;&nbsp;${house.rentType}</a>
                                </div>


                            </div>
                        </div>
                    </div>
                    <!--            房主要求-->
                    <div class="col-md-12">

                        <div class="col-md-4" id="miao7">
                            <a>房主要求</a>
                        </div>

                        <div class="col-md-6">
                            <a>${house.landlordRequire}</a>
                        </div>
                        <div class="col-md-2" style="border-bottom: 1px gainsboro solid">
                        </div>
                    </div>

                    <!--详细要求-->
                    <div class="col-md-12">

                        <div class="col-md-4" id="miao8">
                            <a>详细要求</a>
                        </div>
                        <div class="col-md-8">
                            <div class="row rowx">
                                <c:if test="${cotenancyRequire.gender}">
                                    <div class="col-md-6">
                                        <a>性别</a>
                                    </div>
                                </c:if>
                                <c:if test="${cotenancyRequire.family}">
                                    <div class="col-md-6">
                                        <a>单身</a>
                                    </div>
                                </c:if>
                                <c:if test="${cotenancyRequire.forbidPet}">
                                    <div class="col-md-6">
                                        <a>禁止养宠物</a>
                                    </div>
                                </c:if>
                                <c:if test="${cotenancyRequire.tenantStable}">
                                    <div class="col-md-6">
                                        <a>作息正常</a>
                                    </div>
                                </c:if>
                                <c:if test="${cotenancyRequire.workRestNormal}">
                                    <div class="col-md-6">
                                        <a>工作稳定</a>
                                    </div>
                                </c:if>
                                <c:if test="${cotenancyRequire.forbidSmoke}">
                                    <div class="col-md-6">
                                        <a>禁烟</a>
                                    </div>
                                </c:if>
                                <div class="col-md-6">
                                    <a></a>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!--周边环境-->
                    <div class="col-md-12">
                        <div class="col-md-4" id="miao2">
                            <a>周边环境</a>
                        </div>
                        <div class="col-md-8">
                            <div class="row">
                                <c:if test="${environmentFacility.greenery=='true'}">
                                    <div class="col-md-6">
                                        <a>绿化多</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.trafficConvenient=='true'}">
                                    <div class="col-md-6">
                                        <a>交通便利</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.shoppingConvenient=='true'}">
                                    <div class="col-md-6">
                                        <a>购物方便</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.schoolNearbyHouse=='true'}">
                                    <div class="col-md-6">
                                        <a>学区房</a>
                                    </div>
                                </c:if>
                            </div>
                        </div>
                    </div>
                    <!--配套设备-->
                    <div class="col-md-12">
                        <div class="col-md-4" id="miao3">
                            <a>配套设施</a>
                        </div>
                        <div class="col-md-8">
                            <div class="row rowp">
                                <c:if test="${environmentFacility.fridge}">
                                    <div class="col-md-6">
                                        <a>冰箱</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.television}">
                                    <div class="col-md-6">
                                        <a>电视</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.washingMachine}">
                                    <div class="col-md-6">
                                        <a>洗衣机</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.geyser}">
                                    <div class="col-md-6">
                                        <a>热水器</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.airCondition}">
                                    <div class="col-md-6">
                                        <a>空调</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.broadband}">
                                    <div class="col-md-6">
                                        <a>宽带</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.sofa}">
                                    <div class="col-md-6">
                                        <a>沙发</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.bed}">
                                    <div class="col-md-6">
                                        <a>床</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.heat}">
                                    <div class="col-md-6">
                                        <a>暖气</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.wardrobe}">
                                    <div class="col-md-6">
                                        <a>衣柜</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.cookingable}">
                                    <div class="col-md-6">
                                        <a>可做饭</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.bathroom}">
                                    <div class="col-md-6">
                                        <a>卫生间</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.balcony}">
                                    <div class="col-md-6">
                                        <a>阳台</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.intelligentLock}">
                                    <div class="col-md-6">
                                        <a>智能门锁</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.rangeHood}">
                                    <div class="col-md-6">
                                        <a>油烟机</a>
                                    </div>
                                </c:if>
                                <c:if test="${environmentFacility.gasStove}">
                                    <div class="col-md-6">
                                        <a>燃气灶</a>
                                    </div>
                                </c:if>
                            </div>
                        </div>
                    </div>
                    <!--            费用-->
                    <div class="col-md-12">
                        <div class="col-md-4" id="miao4">
                            <a>费用详情</a>
                        </div>
                        <div class="col-md-8">
                            <div class="row">
                                <div class="col-md-2">
                                    <a>租金</a>
                                </div>
                                <div class="col-md-10">
                                    <a>${cost.rentMoney}</a>
                                </div>
                                <div class="col-md-2">
                                    <a>押金</a>
                                </div>
                                <div class="col-md-10">
                                    <a>${cost.deposit}</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--            评价-->
                    <div class="col-md-12">
                        <div class="col-md-4" id="miao5">
                            <a>租房亮点</a>
                        </div>
                        <div class="col-md-8">
                            <div>
                                <a>${house.houseEvaluate}</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--底部导航栏-->
        <div class="col-md-12">
            <div class="col-md-5">
                <b></b>
            </div>
            <div class="col-md-7"  id="miao6">
                <h2>最近七天被浏览数量</h2>
            </div>

            <div class="col-md-3">
            </div>
            <div class="col-md-9">
                <div id="tu" style="width: 600px;height:400px;"></div>
            </div>
        </div>
        <div class="col-md-12">
        <div id="container"></div>
        </div>
        <script type="text/javascript">

        </script>





        <%@ include file="../nav/footnav.jsp" %>
        <!--底部导航栏end-->
        <script type="text/javascript">
            $(window).on("load",function() {
                datas={"house_id": ${house.id}}
                $.get('/taofang/appointment/dingwei', datas, function (data) {
                let map = new BMap.Map('container');


                    let point = new BMap.Point(data.longitude,data.latitude);
                    // var point = new BMap.Point(120.755675, 31.2657);
                    map.centerAndZoom(point, 15);
                    // 创建点标记
                    map.enableScrollWheelZoom(true);
                    let marker = new BMap.Marker(point);
                    map.addOverlay(marker);
                    // 创建信息窗口
                    let sContent = `<h4 style='margin:0 0 5px 0;'>${house.residentialQuarters}</h4>
                                                    <img style='float:right;margin:0 4px 22px' id='imgDemo' src='http://${path2}/img/${picture_one}' width='139' height='104'/>
                                                    <p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>${house.houseEvaluate}</p> </div>`;
                    let infoWindow = new BMap.InfoWindow(sContent);
                    // marker添加点击事件
                    marker.addEventListener('click', function () {
                        this.openInfoWindow(infoWindow);
                        // 图片加载完毕重绘infoWindow
                        document.getElementById('imgDemo').onload = function () {
                            infoWindow.redraw(); // 防止在网速较慢时生成的信息框高度比图片总高度小，导致图片部分被隐藏
                        };
                    });
                })



            })

            $(function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('tu'));

                // 指定图表的配置项和数据
                option = {
                    xAxis: {
                        type: 'category',

                        data: [ "${d1}","${d2}","${d3}","${d4}","${d5}","${d6}","${d7}"]
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [{
                        data: [${t1},${t2},${t3}, ${t4}, ${t5}, ${t6}, ${t7}],
                        type: 'line'
                    }]
                };


                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            })

            //打分判断
            function iflogin() {

                if(${sessionScope.register.id==null} ) {
                    alert("请先登录")
                    window.location="${path}/login/check";
                }else if (${sessionScope.register.identity!="1"}){
                    alert("您不是租户")
                    $("#myModal2").remove();
                    $("#myModal").remove();
                } else if(${tenant.name==null || tenant.phone==null}){
                    alert("请完善您的个人信息")

                    window.location="${path}/Tenant/info/"+${tenant_id};
                }

            }


            function checkname() {
                let appointment_state = $("#appointment_state").val();
                let appointment_date = $("#appointment_date").val();
                let time_quantum = $("#time_quantum").val();
                let datas = {
                    "agent_id": ${agent.id},
                    "tenant_id": ${tenant_id},
                    "house_id": ${house.id},
                    "appointment_state": appointment_state,
                    "appointment_date": appointment_date,
                    "time_quantum": time_quantum
                }
                // let flag = true;
                $.get('/taofang/appointment/agent', datas, function (data) {
                    alert(data.msg);
                    // flag = false;
                })
            }


            $(function () {
                let divs = document.getElementById("ifconcern");
                let datas = {
                    "tenant_id": ${tenant_id},
                    "house_id": ${house_id}
                }
                $.get('/taofang/appointment/concern', datas, function (data) {
                    if (data.code == 200) {
                        divs.style.background = "red";
                    } else {
                        divs.style.background = "white";
                    }
                })

            });

            function change(btn) {
                let datas = {
                    "tenant_id": ${tenant_id},
                    "house_id": ${house.id}
                }
                if(${sessionScope.register.id== ""} ) {
                    alert("请先登录")
                }else if (${sessionScope.register.identity!="1"}){
                    alert("您不是租户")
                }else {
                    $.get('/taofang/appointment/changeconcern', datas, function (data) {
                        if (data.code == 202) {
                            btn.style.background = "red";
                        } else {
                            btn.style.background = "white";
                        }
                    })
                }
            }


            //多个模态框;

            function clickMode(id) {
                $('#' + id).modal({backdrop: 'static', keyboard: false});
            }

            $(function () {
                $(".form_date").datetimepicker({
                    format: 'yyyy-mm-dd',
                    todayBtn: true,
                    maxView: 'year',
                    minView: 'month'
                });
            });


            $(function () {
                let size = $("#size").val();
                let min = 0;
                for (let i = 0; i <= size; i++) {
                    if (size > 0 & min == 0) {
                        min++;
                        var li = $("<li>");
                        li.attr('data-target', '#myCarousel');
                        li.attr('data-slide-to', '0');
                        li.attr('class', 'active');
                        $("#tr_id1").append(li); //将新创建的td标签插到id为tr_id1的标签中
                    } else if (min > 0) {

                        var li = $("<li>");
                        li.attr('data-target', '#myCarousel');
                        li.attr('data-slide-to', "" + min);
                        $("#tr_id1").append(li); //将新创建的td标签插到id为tr_id1的标签中
                        min++;
                    }
                }

                let min2 = 0;
                if (size > 0 & min2 == 0) {
                    <c:forEach items="${picture}" var="p" begin="0" end="0">
                    var div = $("<div></div>");
                    div.attr('id', 'lun1')
                    div.addClass('item active');
                    $("#lun").append(div); //将新创建的td标签插到id为tr_id1的标签中
                    var img = $("<img>");
                    img.attr('src', 'http://${path2}/img/${p}');
                    img.attr('alt', 'First slide');
                    $("#lun1").append(img)
                    console.log("${p}")
                    </c:forEach>
                    min2 = 1;
                }
                if (min2 == 1 & size != 0) {
                    let m = 2;
                    <c:forEach items="${picture}" var="p" begin="1" end="${size}">
                    m++;
                    var div = $("<div>");
                    div.attr('id', 'lun' + m)
                    div.addClass('item');
                    $("#lun").append(div); //将新创建的td标签插到id为tr_id1的标签中
                    var img = $("<img>");
                    img.attr('src', 'http://${path2}/img/${p}');
                    img.attr('alt', 'Second' + (m - 2) + ' slide');
                    $("#" + "lun" + m).append(img)
                    console.log(m - 2)
                    </c:forEach>
                }
            })


            $(function () {
                var none = '☆';
                var sel = '★';

                //鼠标放上去当前的li和之前所有的li内容全部变为实心五角星，移开变为空心。
                $(".comment li").on("mouseenter", function () {
                    $(this).text(sel).prevAll("li").text(sel).end().nextAll("li").text(none);
                });
                $(".comment li").on("mouseleave", function () {
                    if ($("li.current").length === 0) {
                        $(".current").text(none);
                    } else {
                        $("li.current").text(sel).prevAll("li").text(sel).end().nextAll("li").text(none);
                    }
                });
                //鼠标点击那个li，当你前li和之前所有的li都变成实心五角星，其他变为空心。
                $(".comment li").on("click", function () {


                    $.get('/taofang/appointment/changegrade1', function (data) {
                        if (data.data!="200") {
                            alert(data.msg)
                            if(data.data==501){
                                window.location="${path}/login/check"
                            }
                            $("#myModal2").remove();
                            $("#myModal").remove();

                        } else {
                            $(this).attr("class", "current").siblings("li").removeAttr("class");

                            $(this).attr("class", "current").siblings("li").removeAttr("name");
                            $(this).attr("class", "current").prevAll("li").attr("name", "chazhao");
                            $(this).attr("class", "current").attr("name", "chazhao");
                            let score = $("li[name='chazhao']").length;
                            let agent_id = $("#agentId").val();
                            datas = {"grade": score, "agent_id": agent_id}
                            $.get('/taofang/appointment/changegrade2', datas, function (data) {
                                alert(data.msg);

                            })
                        }

                    })

                })
            });

            $(function () {
                $.ajax({
                    type: 'get',
                    url: '/taofang/appointment/pingfen1/' + ${house_id},
                    success: function (data) {
                        $("#evaluate a").html(data);
                    }
                })
            })



            $(function(){
                let divs = document.getElementById("big");
                let imgs = divs.getElementsByTagName("img");

                let body = document.getElementsByTagName("body")[0];

                for (let i=0;i<imgs.length;i++) {
                    imgs[i].onmouseover=function(){

                        //1. 创建一个div
                        let div = document.createElement("div");
                        div.id="imgDiv";
                        div.className="outer";

                        //创建一个img标签
                        let img = document.createElement("img");
                        img.src=this.src;
                        img.style.width="400px";
                        img.style.height="400px";

                        div.style.left=500+"px";
                        div.style.top = 400+"px";

                        div.appendChild(img);

                        body.appendChild(div);
                    }

                    imgs[i].onmouseout=function(){
                        let div = document.getElementById("imgDiv");
                        body.removeChild(div);
                    }
                }
            })

        </script>


</body>
</html>